home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 1994
/
MacHack 1994.toast
/
MacHack™94
/
Talks & Papers
/
Timothy Knox
/
yerk 3.66
/
Module source
/
inDlg
< prev
next >
Wrap
Text File
|
1994-06-24
|
2KB
|
80 lines
\ general-purpose input dialog support
\ 12/22/84 cbd Version 1
\ 12/03/85 cdn Added close: inDlg in doInDlg for new Dialog
\ 7/06/86 cdn Added 6 check box items & doDeDlg for decompiler
\ 9/02/86 cdn Added doGrDlg for grep utility
\ 12/17/87 rfl fixed so that current resource file is retained
\ 9/01/88 rfl removed draw: fwind
\ 12/26/90 rfl modified to agree with new dialog starting with element #1, not 0
\ 5/22/92 rfl refresh fwind if alive
\ 12/21/92 rfl removed resource stuff
Decimal
:Module indMod
// Dialog
Forget ParamText
11 dialog inDlg
1 hilite: inDlg
\ stubs for utilities
\ ( -- addr len t ) Get response string
: getChoice
4 getText: inDlg
-dup IF str255 -base count True ELSE drop False THEN ;
4 'cfas getChoice False False getChoice
6 'cfas togItem togItem togItem togItem togItem togItem actions: inDlg
\ ( addr len -- addr len t OR f ) Do input dialog with string prompt
\ If user enters a string, it is left on the stack for the application.
: doInDlg
3 init: inDlg getNew: inDlg
3 putText: inDlg
0 255 4 setSelect: inDlg
modal: inDlg
close: inDlg
( draw: fWind ) ;
\ ( flgs #boxes -- ) set current box settings
: putBoxes
5 + 1+ 5 DO
dup 1 and
IF 1 i put: inDlg THEN
1 >>
LOOP drop ;
\ ( #boxes -- flgs ) get current box settings
: getBoxes
0 4 rot 5 +
DO 1 <<
i get: inDlg IF 1 or THEN
-1 +LOOP ;
\ ( addr len -- addr len t OR f ) Do input dialog for Grep
\ If user enters a string, it is left on the stack for the application.
: doGrDlg
5 init: inDlg getNew: inDlg
3 putText: inDlg
0 255 4 setSelect: inDlg
grflgs 3 putBoxes \ show current options
modal: inDlg dup
IF 3 getBoxes -> grflgs THEN \ store new options
close: inDlg
alive: fwind IF draw: fWind THEN ;
\ ( addr len -- addr len t OR f ) Do input dialog for the Decompiler
\ If user enters a string, it is left on the stack for the application.
: doDeDlg
6 init: inDlg getNew: inDlg
3 putText: inDlg
0 255 4 setSelect: inDlg
deflgs 5 putBoxes \ show current options
modal: inDlg dup
IF 5 getBoxes -> deflgs THEN \ store new options
close: inDlg
alive: fwind IF draw: fWind THEN ;
;Module